//导入请求工具类
import request from '@/utils/request.js'

// //导入@/stores/token.js
// import { useTokenStore } from '../stores/token'
// //获取token状态
// const tokenStore = useTokenStore()

//文章分类列表查询
export const articleCategoryListService = () => {
  return request.get('/category')
}

// 添加文章分类
export const articleCategoryAddService = (params) => {
  return request.post('/category', params)
}

//修改分类
export const articleCategoryUpdateService = (categoryModel) => {
  return request.put('/category', categoryModel)
}

//删除分类
export const articleCategoryDeleteService = (id) => {
  return request.delete('/category/' + id)
}

//文章列表查询
export const articleListService = (params) => {
  return request.get('/article', { params: params })
}

//添加文章
export const articleAddService = (articleModel) => {
  return request.post('/article', articleModel)
}

// 修改文章
export const articleUpdateService = (articleModel) => {
  return request.put('/article', articleModel)
}

//删除文章
export const articleDeleteService = (id) => {
  return request.delete('/article/' + id)
}

//查询文章详情
export const articleDetailService = (id) => {
  return request.get('/article/detail/' + id)
}